﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TaxBusiness.Model;
using TaxBusiness.DAL;

namespace TaxBusiness.BLL
{
    public class TheOfficeBLL
    {
        public List<Model.TheOffice> GetDepartments()
        {
            DAL.DepartmentDB departmentdb = new DepartmentDB();
            List<Model.TheOffice> officelist = new List<TheOffice>();
            officelist.Add(new TheOffice { ID = -1, Name = "选择分局" });
            officelist.AddRange(departmentdb.GetList());
            return officelist;
        }

        public List<Model.TheOffice> GetOffice()
        {
            DAL.OfficeDB officedb = new OfficeDB();
            List<Model.TheOffice> officelist = new List<TheOffice>();
            officelist.Add(new TheOffice { ID = -1, Name = "选择部(室)" });
            officelist.AddRange(officedb.GetList());
            return officelist;
        }

        public List<Model.TheOffice> GetBillUnit()
        {
            DAL.BillUnitDB billUnitdb = new BillUnitDB();
            List<Model.TheOffice> officelist = new List<TheOffice>();
            officelist.Add(new TheOffice { ID = -1, Name = "选择单位" });
            officelist.AddRange(billUnitdb.GetList());
            return officelist;
        }

        public string GetDepartmentName(int id)
        {
            DAL.DepartmentDB departmentdb = new DepartmentDB();
            return departmentdb.GetName(id);
        }

        public string GetOfficeName(int id)
        {
            DAL.OfficeDB officedb = new OfficeDB();
            return officedb.GetName(id);
        }

        public string GetBillUnitName(int id)
        {
            DAL.BillUnitDB billunitdb = new BillUnitDB();
            return billunitdb.GetName(id);
        }
    }
}
